1. Field of the Invention
The present invention relates to an image signal processing technique for an image signal such as an optical black level output from a solid state image sensor such as a CMOS sensor or CCD, particularly to the control technique of clamping means in image signal processing.
2. Related Background Art
In general, a solid state image sensor such as a CMOS sensor outputs an optical black (hereafter referred to as OB) from a light shielded pixel as the reference of a signal level. A circuit for processing the signal of a sensor clamps an OB level to a predetermined level and then, performs signal processing such as conversion of the level to a digital value. Normally, as shown in FIG. 12, several light-shielded pixels for respectively outputting an OB level to be clamped are set to several horizontal pixel lines at the upside of a solids state image sensor 11 and several horizontal lines and head portions or final portions of horizontal lines after the horizontal pixel lines. They are referred to as vertical OB ((Optical Black) pixels 51 and horizontal OB pixels 52.
Then, actual signal processing is described below by referring to FIG. 11. In FIG. 11, reference numeral 11 denotes a solid state image sensor. Reference numeral 12 denotes an analog signal processing block which first receives an image signal from the solid state image sensor 11 and which is mainly constituted of a programmable gain control circuit (PGA circuit) for adjusting a CDS circuit for correlated-double-sampling an image signal and the amplitude level of a signal. An output of the analog signal processing block 12 is input to an adding and subtracting circuit 13 for adjusting a DC level and then, input to an A/D converter 14 for converting the output into a digital value. A signal converted into a digital value is output to the outside and input to a feedback loop to adjust an OB level. The feedback loop first compares the OB level converted by the A/D converter 14 with a preset OB target level by an OB level determination block 15. Then, a D/A converter 16 for adjusting a DC level is set in accordance with the comparison result. Then, by inputting an output of the D/A converter 16 to the adding and subtracting circuit 13 and adding or subtracting the output to or from an output of the analog signal processing block 12, the OB level is clamped to an OB target level.
Moreover, a method for determining an abnormal OB pixel due to a defect from the output value and not using the OB pixel for clamping is also contrived. A specific example is shown below. When assuming the resolution of an A/D converter for converting an output of a solid state image sensor into a digital value as 12 bits, the output full scale of the A/D converter is 4095 LBS obtained by subtracting 1 from 212 in accordance with 0 LBS. In this case, approx. 100 to 300 LBS are selected as clamp levels. After sufficiently inputting through clam in a vertical OB pixel period, the pixel of an output shifted from a clamp target value by for example, 10 LBS or more is determined as a defective pixel but it is not used for clamp. Thus, it is possible to prevent a malfunction of clamp due to the defective pixel and keep the quality of an output pixel.
Moreover, Japanese Patent Application Laid-Open No. 2004-80168 ([0011], [0013] and [0014], FIGS. 2 to 4) discloses the following technique as a solution when a black level difference occurs between an effective pixel area and an optical black area for black sinkage. That is, the signal of an OB area is set to zero by referring to an offset value to be added decided from the gain of a gain circuit, accumulated time of a device, time for reading one frame and ambient environmental temperature, from an offset table and adding the value to the clam value in the optical black area. Moreover, pedestal adjusting means is disclosed which integrates and averages outputs of the digital-converted optical black area and adjusts a reference level in an effective pixel area in accordance with the level of the result.
However, in the case of an OB pixel output shift smaller than 10 LSB, even the defect pixel determination method cannot determine the shift as a defective pixel. Light vertically entering a solid state image sensor does not enter an OB pixel by light shielding means. However, light having a long longitudinal coverage in a solid state image sensor such as infrared light is reflected from the back of the solid state image sensor before the light entering a pixel not light-shielded disappears due to photoelectric conversion. Therefore, the possibility for achieving the OB pixel becomes high. Therefore, as shown in FIG. 13, in the case of an OB output when photographing an object containing much infrared light, an output of an OB pixel closest to the object becomes peak and smoothly lowers up to the normal OB level as separating from the object. This is referred to as OB floating. Because a change of OB pixel outputs is smooth, the defect pixel determination method cannot determine the change.
Therefore, when normally clamping an output of a solid state image sensor photographing an object containing much infrared light, an OB level becomes constant as shown in FIG. 14 but image outputs before and after the object containing much infrared light sink in the black direction and images are deteriorated. This is referred to as black sinkage.
To determine an abnormal output of a smoothly changed image, a method for lowering the level for defect determination is considered in a method for determining an abnormal OB pixel due to a defect from its output value and not using the pixel for clamp. However, this method causes a trouble of determining a normal pixel as a defective pixel due to noise when setting a determination level to 2 LSB.
In the case of Japanese Patent Application Laid-Open No. 2004-80168 which is a Japanese patent, an offset addition circuit adds an offset from an offset correction table from various conditions. However, many storage memories are required. The pedestal adjusting means adds an offset by directly using a difference output using the integral average of OB areas. Moreover, because correction is made by using a correction table, storage memories are necessary.
Moreover, FIG. 15 is a block diagram showing a circuit configuration of a general image signal processing apparatus for an image signal output from a solid state image sensor such as a CCD or CMOS sensor. As shown in FIG. 15, the image signal processing apparatus is constituted of a correlated double sampling (CDS) circuit 151, programmable gain amplifier (PGA) 152, AD converter (ADC) 153, comparison circuit 154, clamp level register 155 and clamp circuit 156.
An image signal of a not-illustrated solid state image sensor such as a CCD or CMOS sensor is input to an image signal processing apparatus through an inter terminal IN. Sample hold and amplification are applied to the input image signal by the CDS circuit 151 and programmable gain amplifier 152 and then the image signal is converted from an analog signal into a digital signal by the AD converter 153 and output from an output terminal OUT.
Moreover, in the case of the image signal processing apparatus shown in FIG. 15, the clam circuit 156 controls an offset value to be added to an input image signal so that a black level becomes a predetermined level by using a signal from a light shielded pixel (OB) in a solid state image sensor. Specifically, first, a signal from a light shielded pixel output from the AD converter 153 is compared with a clamp level held by the clamp level register 155 as data by the comparison circuit 154. Then, the clamp circuit 156 performs control according to the comparison result (difference level) by the comparison circuit 154 and adjusts an offset level to be added to the CDS circuit 151 serving as an input portion and supplies the adjusted offset level to the CDS circuit 151. The light shielded pixel (OB) is a pixel which light incoming from an object does not enter though a photoelectric conversion element such as a photodiode is formed in a solid state image sensor.
The above-described conventional image signal processing apparatus has the following problem.
For example, as shown in FIG. 16A, a case is assumed in which a defect 161 is present in light-shielded pixel portions HOB and VOB of a solid state image sensor and a signal at an abnormal level is output as a signal from a light shielded pixel. In this case, the clamp circuit 156 operates so as to clamp the abnormal-level signal and so that an error at a clamp level does not occur. That is, in the case of a solid state image sensor, it is requested that there is no defect even for a light shielded pixel and this becomes a factor for lowering the yield of solid state image sensor.
Moreover, as shown in FIG. 16B for example, a case is assumed in which when photographing a high-luminance object, excessive light quantity enters a solid stage image sensor and light also enters light-shielded pixel portions HOB and VOB of the device and thereby, a signal from a light shielded pixel fluctuates. In this case, because the clamp circuit 156 operates so as to performing clamping by using the signal level of the circuit 156, an error at a clamp level occurs. As shown in FIG. 16B, a signal level from a light shielded pixel 163 rises in a high-luminance area 162 and the clamp circuit 156 operates so as to lower the signal level. As a result, because the level of the row concerned (high luminance area 162) is totally lowered, the level is zonally lowered as illustrated.
However, there is the following method as a method for avoiding erroneous clamping. That is, the following clamp levels are used: a first clamp level using a signal from a light shielded pixel in a solid state image sensor and a second clamp level using a signal level in a horizontal blanking period in which a signal is not read from a photoelectric conversion element (pixel). Then, when the first clamp level becomes an abnormal level, it is switched to the second clamp level (for example, refer to Japanese Patent Application Laid-Open No. H9-247552 which is a Japanese patent).
For the above-described problem, it is one of effective techniques to decrease errors at a clamp level by sufficiently decreasing the gain value of the clamp circuit 156. However, when setting the gain of the clamp circuit 156 to a small value, the following problem occurs. That is, when shading in which an offset value changes in the vertical direction of a solid state image sensor is large, correction becomes insufficient. Therefore, because a gain is actually set in accordance with the relation of the trade-off, sufficiently decreasing the gain value of the clamp circuit 156 is not sufficient to solve the above described problem.
As an already-known method for solving these problems, there is a method for storing the address of a defective pixel among light shielded pixels in storing means (generally, nonvolatile memory is used) and excluding a signal from a defective light-shielded pixel when deciding a clamp level. However, this method has a problem that a circuit scale is increased because storing means is necessary, it is necessary to perform test and adjustment every solid state image sensor and an integrated circuit of a special process like a nonvolatile memory is necessary.
Moreover, as another already-known method, there is a method for averaging signals from a plurality of light shielded pixel portions and performing clamping by using a signal level obtained as the average of the signals. In the case of this method, it is possible to decrease influences of a signal level shift due to a defect of a light shielded pixel or light entrance to a certain extent and perform clamping under a condition in which the number of random noises is small. However, when the shift of a level of a signal from a light shielded pixel is large, there is a problem that it is impossible to sufficiently reduce errors at a clamp level though it is possible to reduce influences to a certain extent by averaging.